home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
E-G
/
educationstacks.sea
/
Circuits
/
card_6536.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
8KB
|
398 lines
-- card: 6536 from stack: in
-- bmap block id: 6903
-- flags: 0000
-- background id: 2693
-- name:
----- HyperTalk script -----
on calculate
-- Since the Wheatstone Bridge is an example of the previous card's
-- resistor network, I use the same names for the resistors. This
-- means that the user's Rx is R3 in this script, while the user's
-- R3 is R4 here.
get char 1 of card field "R1"
if it="+" then
delete char 1 of card field "R1"
end if
put card field "R1" into R1
put abs(R1) into R1
put R1 into card field "R1"
get char 1 of card field "R2"
if it="+" then
delete char 1 of card field "R2"
end if
put card field "R2" into R2
put abs(R2) into R2
put R2 into card field "R2"
get char 1 of card field "R3"
if it="+" then
delete char 1 of card field "R3"
end if
put card field "R3" into R3
put abs(R3) into R3
put R3 into card field "R3"
get char 1 of card field "R4"
if it="+" then
delete char 1 of card field "R4"
end if
put card field "R4" into R4
put abs(R4) into R4
put R4 into card field "R4"
get char 1 of card field "R5"
if it="+" then
delete char 1 of card field "R5"
end if
put card field "R5" into R5
put abs(R5) into R5
put R5 into card field "R5"
get char 1 of card field "RV"
if it="+" then
delete char 1 of card field "RV"
end if
put card field "RV" into RV
put abs(RV) into RV
put RV into card field "RV"
get char 1 of card field "EMF"
if it="+" then
delete char 1 of card field "EMF"
end if
put card field "EMF" into EMF
put EMF into card field "EMF"
if R1=0 and R2=0 and R3=0 and R4=0 then
put 0 into RE
else
if R5=0 and R1=0 and R2=0 then
put R3*R4/(R3+R4) into RE
else
if R5=0 and R3=0 and R4=0 then
put R1*R2/(R1+R2) into RE
else
put (R2*R3*(R1+R4)+R1*R4*(R2+R3)+R5*(R1+R3)*(R2+R4))/ ((R1+R2)*(R3+R4)+R5*(R1+R2+R3+R4)) into RE
end if
end if
end if
put RE + RV into R
if R=0 then
put "zap" into card field "I"
exit calculate
end if
set numberFormat to "0"
put (1000000*EMF/R)*(R2*R3-R1*R4)/((R1+R2)*(R3+R4)+R5*(R1+R2+R3+R4)) into card field "I5"
set numberFormat to "0.0"
put 1000*EMF/R into card field "I"
end calculate
on closeField
end closeField
-- part 1 (button)
-- low flags: 00
-- high flags: 0001
-- rect: left=258 top=299 right=332 bottom=300
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 2 (button)
-- low flags: 00
-- high flags: 0001
-- rect: left=308 top=299 right=332 bottom=350
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 3 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=43 top=74 right=86 bottom=86
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R1
-- part 4 (field)
-- low flags: 80
-- high flags: 0000
-- rect: left=189 top=74 right=87 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R3
-- part 5 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=43 top=171 right=183 bottom=86
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R2
-- part 6 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=188 top=170 right=182 bottom=232
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R4
-- part 7 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=176 top=239 right=251 bottom=218
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: I
-- part 8 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=58 top=249 right=261 bottom=102
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: RV
-- part 9 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=152 top=118 right=131 bottom=202
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: I5
-- part 10 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=79 top=119 right=131 bottom=112
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R5
-- part 11 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=112 top=264 right=276 bottom=144
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: EMF
-- part 12 (button)
-- low flags: 00
-- high flags: 2003
-- rect: left=259 top=167 right=185 bottom=275
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseDown
set hilite of card button "off" to false
set hilite of card button "on" to true
calculate
end mouseDown
on mouseUp
set hilite of card button "on" to false
set hilite of card button "off" to true
put "" into card field "I5"
put "" into card field "I"
end mouseUp
-- part 13 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=179 top=47 right=69 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Randomize
----- HyperTalk script -----
on mouseUp
put (the random of 1000)/10 into card field "R3"
end mouseUp
-- part 14 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=207 top=93 right=113 bottom=275
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Show Rx
----- HyperTalk script -----
on mouseDown
set visible of card field "R3" to true
end mouseDown
on mouseUp
set visible of card field "R3" to false
end mouseUp
-- part 17 (button)
-- low flags: 00
-- high flags: 8000
-- rect: left=276 top=158 right=175 bottom=304
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: On
-- part 18 (button)
-- low flags: 00
-- high flags: C000
-- rect: left=276 top=176 right=193 bottom=304
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Off
-- part contents for background part 8
----- text -----
C6. Wheatstone Bridge
-- part contents for card part 4
----- text -----
72.8
-- part contents for card part 6
----- text -----
100
-- part contents for card part 3
----- text -----
39.5
-- part contents for card part 5
----- text -----
50
-- part contents for card part 8
----- text -----
200
-- part contents for card part 10
----- text -----
100
-- part contents for card part 11
----- text -----
50